{extend name="public:layout" /}

{block name="title"}
	<title>{:site('siteName')}-个人中心</title>
{/block}

{block name="css"}
	<style>
		body{font-size:14px;font-family:"微软雅黑";background:#fff;}
	</style>
{/block}

{block name="content"}
	<!--user_head-->
	<div class="user_head">
	    <div class="user_name" style="padding-top:20px;">
	        <p class="user_name_left">UID：</p><p class="user_name_right">{:session('user.user_id')}</p>
	    </div>
	    <div class="user_name">
	        <p class="user_name_left">用户名：</p><p class="user_name_right">{$U.username}</p>
	    </div>
	    <div class="user_name">
	        <p class="user_name_left">真实姓名：</p><p class="user_name_right">{$U.realname}</p>
	    </div>
	    <div class="layui-progress" style="width: 60%; margin-left: 20%;">
	        <div class="layui-progress-bar" lay-percent="{$tag['progress']}%" style="background-color: #ffd51c;"></div>
	    </div>
	    <div class="user_name">安全等级：{$tag['text']}</div>
	    <div class="user_name">上次登录：{:date('m/d H:i',$U['login_time'])}</div>
	    <div class="user_name_foot">
	        <ul>
	            <li><span>{$currency.recharge}</span><br /><span>{$U.recharge}</span></li>
	            <li><span>{$currency.money}</span><br /><span>{$U.money}</span></li>
	            <li style="border:none;"><span>{$currency.game}</span><br /><span>{$U.game}</span></li>
	        </ul>
	    </div>
	</div>
	<!-- user_center -->
	<div class="user_center">
	    <div class="user_center1">
	        <ul>
	            <li>
	            	{if $U['agent']}
						<a href="{:url('index/sell/orders')}">接单</a>
					{else /}
						<a href="{:url('index/agent/index')}">充值</a>
					{/if}
	            </li>
	            <li><a href="{:url('index/sell/sell')}">出售</a></li>
	            <li><a href="{:url('index/user/transfer')}">转账</a></li>
	            <li><a href="{:url('index/user/withdraw')}">提现</a></li>
	        </ul>
	    </div>
	    <div class="user_center2">
	        <ul>
	            <li onclick="location.href='/account/daily.html'">今日有享豆：<span>{$dayPrice}</span></li>
	            <li onclick="location.href='/account/main.html'">友豆账号<span>：{$mainCount}</span></li>
	            <li onclick="location.href='/account/son.html'">共享账号<span>：{$sonCount}</span></li>
	        </ul>
	    </div>
	    <div class="user_center3">
	        <ul>
	            <li><a href="{:url('index/user/info')}"><img src="__STATIC__/{$theme}/img/con_1.png"/><br /><p>基本信息</p></a></li>
	            <li><a href="{:url('index/user/invite')}"><img src="__STATIC__/{$theme}/img/con_2.png"/><br /><p>邀请好友</p></a></li>
	            <li style="border-right:none;"><a href="/article/list/1"><img src="__STATIC__/{$theme}/img/con_3.png"/><br /><p>最新公告</p></a></li>
	            <li><a href="/account/main.html"><img src="__STATIC__/{$theme}/img/con_4.png"/><br /><p>友豆账号</p></a></li>
	            <li><a href="/account/son.html"><img src="__STATIC__/{$theme}/img/con_5.png"/><br /><p>共享账号</p></a></li>
	            <li style="border-right:none;"><a href="/account/record?type=1"><img src="__STATIC__/{$theme}/img/con_6.png"/><br /><p>账户明细</p></a></li>
	            <li><a href="/article/list/4"><img src="__STATIC__/{$theme}/img/con_7.png"/><br /><p>常见问题</p></a></li>
	            <li><a href="/article/list/5"><img src="__STATIC__/{$theme}/img/con_8.png"/><br /><p>帮助中心</p></a></li>
	            <li style="border-right:none;"><a href="/article/list/9"><img src="__STATIC__/{$theme}/img/con_9.png"/><br /><p>联系我们</p></a></li>
	        </ul>
	    </div>
	</div>

{/block}

{block name="script"}
	<script>
		layui.use('element',
		function() {
		    var $ = layui.jquery,
		    element = layui.element(); //Tab的切换功能，切换事件监听等，需要依赖element模块
		    //触发事件
		    var active = {
		        setPercent: function() {
		            //设置50%进度
		            element.progress('demo', '50%')
		        },
		        loading: function(othis) {
		            var DISABLED = 'layui-btn-disabled';
		            if (othis.hasClass(DISABLED)) return;

		            //模拟loading
		            var n = 0,
		            timer = setInterval(function() {
		                n = n + Math.random() * 10 | 0;
		                if (n > 100) {
		                    n = 100;
		                    clearInterval(timer);
		                    othis.removeClass(DISABLED);
		                }
		                layui.element().progress('demo', n + '%');
		            },
		            300 + Math.random() * 1000);

		            othis.addClass(DISABLED);
		        }
		    };

		    $('.site-demo-active').on('click',
		    function() {
		        var othis = $(this),
		        type = $(this).data('type');
		        active[type] ? active[type].call(this, othis) : '';
		    });
		});
	</script>
{/block}
